<template>
	<view class="p-16  pb-safe-area bg-white">
		<view class="pb-20 flex flex-column gap-6">
			<text class="fs-20 fw-bold">{{detail.title}}</text>
			<text class="fs-12 text-999">{{detail.views}}阅读 {{detail.create_time}}</text>
		</view>
		<mp-html :content="detail.content"></mp-html>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	import { getArticleDetail } from '@/api/article.js'
	import { onLoad } from '@dcloudio/uni-app'
	const detail = ref({})
	onLoad((e) => {
		getDetail(e.id)
	})
	const getDetail = (id) => {
		getArticleDetail({ id: id }).then(res => {
			detail.value = res.data
			uni.setNavigationBarTitle({
				title:detail.value.title
			})
		})
	}
</script>

<style>
	page {
		letter-spacing: 0px;
	}
</style>